﻿// Connect_MesPost_Dlg.cpp: 实现文件
//

#include "pch.h"
#include "CurProject.h"
#include "Connect_MesPost_Dlg.h"
#include "afxdialogex.h"
#include "resource.h"

#include "xxWidgetControl.h"
#include "xxFileProcess.h"
#include "mmFile_Paras.h"

// CConnect_MesPost_Dlg 对话框
CConnect_MesPost_Dlg * m_Connect_MesPost;

IMPLEMENT_DYNAMIC(CConnect_MesPost_Dlg, CDialogEx)

CConnect_MesPost_Dlg::CConnect_MesPost_Dlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_Connect_MesPost, pParent)
{

}

CConnect_MesPost_Dlg::~CConnect_MesPost_Dlg()
{
}

void CConnect_MesPost_Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CConnect_MesPost_Dlg, CDialogEx)
	ON_BN_CLICKED(IDC_BUTTON_Save, &CConnect_MesPost_Dlg::OnBnClickedButtonSave)
END_MESSAGE_MAP()


// CConnect_MesPost_Dlg 消息处理程序


void CConnect_MesPost_Dlg::OnBnClickedButtonSave()
{
	mmConnect_MesPost->Apply_Mes = xx::DefaultCK(this, IDC_CHECK_ApplyMes, mmConnect_MesPost->iniField, L"Apply_Mes", mmFile_Paras.iniModelPath());
	mmConnect_MesPost->IP = xx::DefaultWidget(this, IDC_IPADDRESS, mmConnect_MesPost->iniField, L"IP", mmFile_Paras.iniModelPath(), L"");
	mmConnect_MesPost->port = xx::DefaultWidget(this, IDC_EDIT_Port, mmConnect_MesPost->iniField, L"port", mmFile_Paras.iniModelPath(), 0);
	mmConnect_MesPost->Procode = xx::DefaultWidget(this, IDC_EDIT_Procode, mmConnect_MesPost->iniField, L"Procode", mmFile_Paras.iniModelPath(), L"");
	mmConnect_MesPost->Dmcode = xx::DefaultWidget(this, IDC_EDIT_Dmcode, mmConnect_MesPost->iniField, L"Dmcode", mmFile_Paras.iniModelPath(), L"");
	mmConnect_MesPost->Fcode = xx::DefaultWidget(this, IDC_EDIT_Fcode, mmConnect_MesPost->iniField, L"Fcode", mmFile_Paras.iniModelPath(), L"");

}


BOOL CConnect_MesPost_Dlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	xx::WriteCK(this, IDC_CHECK_ApplyMes, mmConnect_MesPost->Apply_Mes);
	xx::WriteWidget(this, IDC_IPADDRESS, mmConnect_MesPost->IP);
	xx::WriteWidget(this, IDC_EDIT_Port, mmConnect_MesPost->port);
	xx::WriteWidget(this, IDC_EDIT_Procode, mmConnect_MesPost->Procode);
	xx::WriteWidget(this, IDC_EDIT_Dmcode, mmConnect_MesPost->Dmcode);
	xx::WriteWidget(this, IDC_EDIT_Fcode, mmConnect_MesPost->Fcode);


	return TRUE;
}
